import alovaInstance from "@/utils/request";

//根据id删除教师
export function deleteTeacher(id, updateBy) {
  return alovaInstance.Put(`/teacher/adminDeleteTeacher?teaId=${id}&updateBy=${updateBy}`)
}

//新增单个教师
export function saveTeacher(form) {
  return alovaInstance.Post('/teacher/adminAddOneTeacher', form)
}

//修改单个教师信息
export function updateTeacher(form) {
  return alovaInstance.Put('/teacher/adminModifyOneTeacher', form)
}

//根据id查询单个教师信息
export function SelectTeacherByid(id) {
  return alovaInstance.Get('/teacher/selectById', {
    params: {
      teaId: id
    }
  })
}

//教师初审材料
export function firstChexk(form) {
  return alovaInstance.Put('/teacher/firstCheck', form)
}

//教师初审通过后新增一条初审记录
export function firstRecord(form) {
  return alovaInstance.Post('/teacher/firstRecord', form)
}

//教师初审通过给学生发送信息
export function addSuccessMessage(stuId, teaId) {
  return alovaInstance.Post(`/messageWithRole/teaAddSuccessMessToStu?stuId=${stuId}&teaId=${teaId}`)
}

//教师初审打回给学生发送信息
export function addErrorMessage(stuId, teaId) {
  return alovaInstance.Post(`/messageWithRole/teaAddErrorMessToStu?stuId=${stuId}&teaId=${teaId}`)
}

//教师查看单个审核记录
export function checkRecord(id) {
  return alovaInstance.Get('/teacher/getRecordById', {
    params: {
      recordId: id
    }
  })
}